package org.zjz.basket.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.zjz.basket.dto.LoginFormDTO;
import org.zjz.basket.dto.UserInfoDTO;
import org.zjz.basket.service.UserService;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author zjz
 * @since 05/07/2022 - 11:57 下午
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @PostMapping("/login")
    String login(@RequestBody LoginFormDTO dto) {
        return userService.login(dto);
    }

    @GetMapping("/info")
    UserInfoDTO info() {
        return userService.info();
    }
}
